# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.5)
project(kinextdk_example LANGUAGES C CXX)


############################
#### AZURE KINECT SDK ######
############################

message("Finding K4A SDK binaries")

# Disable cached locations for K4A SDK binaries.
# Do this to force the search logic to happen correctly.
# If we don't disable these cached directories, we
# won't be able to tell the difference between the ext/sdk location
# and the system installed version on linux. Since we have to treat these
# differently (one needs install, one doesn't) we must disable the cache
# so that find_package(k4a) will fail in all cases if not installed via the .deb.
unset(k4a_DIR CACHE)

# Force running the Findk4a.cmake module
find_package(k4a  REQUIRED)
find_package(OpenCV REQUIRED)
set(K4A_LIBS k4a::k4a;k4a::k4arecord)


# This reads the K4A_LIBS and K4A_INSTALL_REQUIRED variables and decides how to install
# the various shared objects / DLLs

##################################
###### END AZURE KINECT SDK ######
##################################
include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(green_screen main.cpp)
target_link_libraries(green_screen 
			PRIVATE 
			k4a::k4a  
			${OpenCV_LIBS})
